<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/1/6
  Time: 11:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path= request.getContextPath();
    String  basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>我的拍卖</title>
    <link rel="stylesheet" href="<%=basePath%>/statics/backcss/css/salldetail.css" type="text/css">
    <script type="text/javascript" src="<%=basePath%>/plugins/jquery.min.js"></script>
</head>
<body>
<div class="nav_area">
    <div class="container">
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li class="nav_index"><a href="<%=basePath%>/canvas/listdo">首页</a></li>
                            <li class="nav_bidding"><a href="#">开拍标的</a></li>
                            <li class="nav_announcement"><a href="#">拍卖公告</a></li>
                            <li class="nav_information"><a href="<%=basePath%>/sall/salls">拍卖资讯</a></li>
                            <li class="nav_case"><a href="#">成交案例</a></li>
                            <li class="nav_source"><a href="#">资产源提报</a></li>
                            <li class="nav_mine"><a href="<%=basePath%>/sall/index">我的拍卖</a></li>
                            <li class="nav_about"><a href="#">关于我们</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div class="container bd_d8" style="height: 430px;">
        <div class="detail_headLeft">
            <div class="imgZoom_Area">
                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1547094079235&di=1a26e71876395f269f6c189a643bf750&imgtype=0&src=http%3A%2F%2Fpic31.photophoto.cn%2F20140413%2F0006019684558307_b.jpg" />
            </div>
        </div>
        <div class="rightpart">
            <div>
                <ul>
                    <li>
                        选择作品：<select >
                        <c:forEach items="${sessionScope.myCanvas}" var="canvas">
                            <option id="cid"  value ="${canvas.cid}">${canvas.name}</option>
                        </c:forEach>
                    </select><br>
                    </li>
                    <li>
                        起&nbsp;拍&nbsp;价：<input id="maxprice" name="maxprice" type="text"><br>
                    </li>
                    <li>
                        竞价截止日期：<input id="endtime" name="endtime" type="date"><br>
                    </li>
                    <li>
                        <input type="submit" id="submit" value="提交" class="bt"><br>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<hr style="box-sizing: border-box;background-color:#333;border: solid 1px #d8d8d8;both;overflow:hidden;margin-top:60px " />
<script>
    $(function () {
        $("#submit").click(function () {
            var obj=new Object()
            // obj.uid=$("#uid").val()
            obj.cid=$("#cid").val()
            obj.maxprice=$("#maxprice").val()
            obj.endTime=$("#endtime").val()
            console.log(obj.maxprice);
            $.ajax({
                url:'setsall',
                type:'post',
                datatype:'json',
                contentType:'application/json;charset=utf-8',
                data:JSON.stringify(obj),
                success:function(data){
                    var jsonobj=eval("("+data+")")
                    alert(jsonobj.message)
                    window.location.reload();
                    window.close();
                },
                error:function (data) {
                    if ((new Date(obj.endTime)).getTime()<(new Date()).getTime())
                        alert("时间错误！")
                    else
                        alert("没有可拍卖油画")
                }
            });
        })
    })
</script>
</body>
</html>
